\(\int (a+i a \tan (e+f x)) (A+B \tan (e+f x)) (c-i c \tan (e+f x)) \, dx\) [669]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [C] (verification not implemented)
   Sympy [C] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 37, antiderivative size = 32 \[ \int (a+i a \tan (e+f x)) (A+B \tan (e+f x)) (c-i c \tan (e+f x)) \, dx=\frac {a A c \tan (e+f x)}{f}+\frac {a B c \tan ^2(e+f x)}{2 f} \]

[Out]

a*A*c*tan(f*x+e)/f+1/2*a*B*c*tan(f*x+e)^2/f

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.027, Rules used = {3669} \[ \int (a+i a \tan (e+f x)) (A+B \tan (e+f x)) (c-i c \tan (e+f x)) \, dx=\frac {a A c \tan (e+f x)}{f}+\frac {a B c \tan ^2(e+f x)}{2 f} \]

[In]

Int[(a + I*a*Tan[e + f*x])*(A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x]),x]

[Out]

(a*A*c*Tan[e + f*x])/f + (a*B*c*Tan[e + f*x]^2)/(2*f)

Rule 3669

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a*(c/f), Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1)*(A + B*x), x
], x, Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {(a c) \text {Subst}(\int (A+B x) \, dx,x,\tan (e+f x))}{f} \\ & = \frac {a A c \tan (e+f x)}{f}+\frac {a B c \tan ^2(e+f x)}{2 f} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.04 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.00 \[ \int (a+i a \tan (e+f x)) (A+B \tan (e+f x)) (c-i c \tan (e+f x)) \, dx=\frac {a B c \sec ^2(e+f x)}{2 f}+\frac {a A c \tan (e+f x)}{f} \]

[In]

Integrate[(a + I*a*Tan[e + f*x])*(A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x]),x]

[Out]

(a*B*c*Sec[e + f*x]^2)/(2*f) + (a*A*c*Tan[e + f*x])/f

Maple [A] (verified)

Time = 0.06 (sec) , antiderivative size = 27, normalized size of antiderivative = 0.84

method result size
derivativedivides \(\frac {a c \left (\frac {B \tan \left (f x +e \right )^{2}}{2}+A \tan \left (f x +e \right )\right )}{f}\) \(27\)
default \(\frac {a c \left (\frac {B \tan \left (f x +e \right )^{2}}{2}+A \tan \left (f x +e \right )\right )}{f}\) \(27\)
parallelrisch \(\frac {B a c \tan \left (f x +e \right )^{2}+2 a c A \tan \left (f x +e \right )}{2 f}\) \(30\)
norman \(\frac {a A c \tan \left (f x +e \right )}{f}+\frac {a B c \tan \left (f x +e \right )^{2}}{2 f}\) \(31\)
risch \(\frac {2 a c \left (i A \,{\mathrm e}^{2 i \left (f x +e \right )}+B \,{\mathrm e}^{2 i \left (f x +e \right )}+i A \right )}{f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{2}}\) \(50\)
parts \(a c A x +\frac {B a c \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 f}+\frac {B a c \left (\frac {\tan \left (f x +e \right )^{2}}{2}-\frac {\ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}\right )}{f}+\frac {a c A \left (\tan \left (f x +e \right )-\arctan \left (\tan \left (f x +e \right )\right )\right )}{f}\) \(80\)

[In]

int((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e)),x,method=_RETURNVERBOSE)

[Out]

1/f*a*c*(1/2*B*tan(f*x+e)^2+A*tan(f*x+e))

Fricas [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.24 (sec) , antiderivative size = 54, normalized size of antiderivative = 1.69 \[ \int (a+i a \tan (e+f x)) (A+B \tan (e+f x)) (c-i c \tan (e+f x)) \, dx=-\frac {2 \, {\left ({\left (-i \, A - B\right )} a c e^{\left (2 i \, f x + 2 i \, e\right )} - i \, A a c\right )}}{f e^{\left (4 i \, f x + 4 i \, e\right )} + 2 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f} \]

[In]

integrate((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e)),x, algorithm="fricas")

[Out]

-2*((-I*A - B)*a*c*e^(2*I*f*x + 2*I*e) - I*A*a*c)/(f*e^(4*I*f*x + 4*I*e) + 2*f*e^(2*I*f*x + 2*I*e) + f)

Sympy [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.15 (sec) , antiderivative size = 82, normalized size of antiderivative = 2.56 \[ \int (a+i a \tan (e+f x)) (A+B \tan (e+f x)) (c-i c \tan (e+f x)) \, dx=\frac {2 i A a c + \left (2 i A a c e^{2 i e} + 2 B a c e^{2 i e}\right ) e^{2 i f x}}{f e^{4 i e} e^{4 i f x} + 2 f e^{2 i e} e^{2 i f x} + f} \]

[In]

integrate((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e)),x)

[Out]

(2*I*A*a*c + (2*I*A*a*c*exp(2*I*e) + 2*B*a*c*exp(2*I*e))*exp(2*I*f*x))/(f*exp(4*I*e)*exp(4*I*f*x) + 2*f*exp(2*
I*e)*exp(2*I*f*x) + f)

Maxima [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 29, normalized size of antiderivative = 0.91 \[ \int (a+i a \tan (e+f x)) (A+B \tan (e+f x)) (c-i c \tan (e+f x)) \, dx=\frac {B a c \tan \left (f x + e\right )^{2} + 2 \, A a c \tan \left (f x + e\right )}{2 \, f} \]

[In]

integrate((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e)),x, algorithm="maxima")

[Out]

1/2*(B*a*c*tan(f*x + e)^2 + 2*A*a*c*tan(f*x + e))/f

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 106 vs. \(2 (30) = 60\).

Time = 0.35 (sec) , antiderivative size = 106, normalized size of antiderivative = 3.31 \[ \int (a+i a \tan (e+f x)) (A+B \tan (e+f x)) (c-i c \tan (e+f x)) \, dx=\frac {B a c \tan \left (f x\right )^{2} \tan \left (e\right )^{2} - 2 \, A a c \tan \left (f x\right )^{2} \tan \left (e\right ) - 2 \, A a c \tan \left (f x\right ) \tan \left (e\right )^{2} + B a c \tan \left (f x\right )^{2} + B a c \tan \left (e\right )^{2} + 2 \, A a c \tan \left (f x\right ) + 2 \, A a c \tan \left (e\right ) + B a c}{2 \, {\left (f \tan \left (f x\right )^{2} \tan \left (e\right )^{2} - 2 \, f \tan \left (f x\right ) \tan \left (e\right ) + f\right )}} \]

[In]

integrate((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e)),x, algorithm="giac")

[Out]

1/2*(B*a*c*tan(f*x)^2*tan(e)^2 - 2*A*a*c*tan(f*x)^2*tan(e) - 2*A*a*c*tan(f*x)*tan(e)^2 + B*a*c*tan(f*x)^2 + B*
a*c*tan(e)^2 + 2*A*a*c*tan(f*x) + 2*A*a*c*tan(e) + B*a*c)/(f*tan(f*x)^2*tan(e)^2 - 2*f*tan(f*x)*tan(e) + f)

Mupad [B] (verification not implemented)

Time = 8.98 (sec) , antiderivative size = 25, normalized size of antiderivative = 0.78 \[ \int (a+i a \tan (e+f x)) (A+B \tan (e+f x)) (c-i c \tan (e+f x)) \, dx=\frac {a\,c\,\mathrm {tan}\left (e+f\,x\right )\,\left (2\,A+B\,\mathrm {tan}\left (e+f\,x\right )\right )}{2\,f} \]

[In]

int((A + B*tan(e + f*x))*(a + a*tan(e + f*x)*1i)*(c - c*tan(e + f*x)*1i),x)

[Out]

(a*c*tan(e + f*x)*(2*A + B*tan(e + f*x)))/(2*f)